package br.com.raxataxi.modelo;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table (name="CHAT")
public class Chat {
	
	@Id
	@GeneratedValue (strategy=GenerationType.AUTO)
	@Column (name="IDCHAT")
	private long idChat;
	@Temporal (TemporalType.DATE)
	@Column (name="DATACHAT")
	private Date dataCaht;
	@Temporal (TemporalType.TIME)
	@Column (name="HORACHAT")
	private Date horaChat;
	
	//Relacionamentos
	@ManyToMany (cascade=CascadeType.ALL)
	private List<Usuario> chatUsuario;
	
	
	public long getIdChat() {
		return idChat;
	}
	public void setIdChat(long idChat) {
		this.idChat = idChat;
	}
	public Date getDataCaht() {
		return dataCaht;
	}
	public void setDataCaht(Date dataCaht) {
		this.dataCaht = dataCaht;
	}
	public Date getHoraChat() {
		return horaChat;
	}
	public void setHoraChat(Date horaChat) {
		this.horaChat = horaChat;
	}
	public List<Usuario> getChatUsuario() {
		return chatUsuario;
	}
	public void setChatUsuario(List<Usuario> chatUsuario) {
		this.chatUsuario = chatUsuario;
	}
	
}
